<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>衣服</title>
    <link rel="stylesheet" type="text/css" href="/Public/home/css/det.css">
    <link rel="stylesheet" type="text/css" href="/Public/home/css/css.css">
</head>
<div id="qq">
    <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=244103592&site=qq&menu=yes">
        <img border="0" src="/Public/home/imeags/qq.png" alt="点击这里给我发消息" title="点击这里给我发消息"/>
    </a>
</div>

<body>
<div id="cont">
    <div id="head">
    <a href="/index.php/Home/">
        <img id="logo" src="/Public/home/imeags/logo.png">
    </a>
    <ul>
        <?php if(is_array($sorts)): $i = 0; $__LIST__ = $sorts;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li><a href="/index.php/Home/Sort/sort/id/<?php echo ($vo["id"]); ?>"><?php echo ($vo["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
    </ul>
    <?php if(is_array($sor)): $i = 0; $__LIST__ = $sor;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><p><font id="current"><img src="/Public/home/imeags/code.png"><?php echo ($vo["title"]); ?></font></p><?php endforeach; endif; else: echo "" ;endif; ?>
    <div id="login">
        <ul>
            <li class="login"><img src="/Public/home/imeags/my.png"><a href="
                    <?php
 $a = session('member'); if($a[0]['username'] == ''|| $a[0]['username'] == null) { echo '/index.php/Home/Login/login'; }else{ echo '/index.php/Home/Personal/personal'; } ?>">
                <?php
 $a = session('member'); if($a[0]['username'] == ''|| $a[0]['username'] == null) { echo '登录'; }else{ echo $a[0]['username']; } ?>
            </a></li>
            <li class="login"><img src="/Public/home/imeags/cart.png"><a href="/index.php/Home/Cart/cart">购物车</a></li>
        </ul>
    </div>
</div>
    <div id="main">
        <div id="mat">
            <?php if(is_array($good_es)): $i = 0; $__LIST__ = $good_es;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><img src="<?php echo ($vo["goods_pic"]); ?>">
                <span>
                <h2><?php echo ($vo["goods_title"]); ?></h2>
                <div id="desc">
                <font><?php echo ($vo["goods_desc"]); ?></font>
                <p>价格：￥<?php echo ($vo["goods_price"]); ?>元</p>
                </div>
                <div id="pay">
                <a href="/index.php/Home/Payment/payment/id/<?php echo ($vo["id"]); ?>">购买</a>&nbsp;&nbsp;<a id="addCart" href="javascript:;">加入购物车</a>
                </div>
            </span><?php endforeach; endif; else: echo "" ;endif; ?>
        </div>
        <div id="stand">
            <?php if(is_array($good)): $i = 0; $__LIST__ = $good;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="show">
                    <h2><a href="/index.php/Home/Details/details/id/<?php echo ($vo["id"]); ?>"><?php echo ($vo["goods_title"]); ?></a></h2>
                    <a href="/index.php/Home/Details/details/id/<?php echo ($vo["id"]); ?>"><img src="<?php echo ($vo["goods_pic"]); ?>"></a>
                    <p>价格：￥<?php echo ($vo["goods_price"]); ?>元</p>
                </div><?php endforeach; endif; else: echo "" ;endif; ?>
        </div>
    </div>
   <div id="link">
    <h2>友情链接区域</h2>
    <ul>
        <?php if(is_array($links)): $i = 0; $__LIST__ = $links;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li><a href="<?php echo ($vo["url"]); ?>"><?php echo ($vo["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
    </ul>
</div>
</div>
<div id="footer">
    <img src="/Public/home/imeags/footer.png">
    <p id="bq">©2004-2017 Koninklijke Philips N.V.版权所有。</p>
    <p id="icp">沪ICP备09062110号 沪公网安备31010602001824号</p>
</div>
</div>
</body>
<script src="/Public/home/js/jquery-1.11.0.min.js"></script>
<script languge=javascript>
    // @TODO 添加购物车商品
    $(function () {
        var data = {};
        $('#addCart').click(function () {
            data.goods_id = window.location.href.substring(window.location.href.lastIndexOf('/') + 1);
            $.post("<?php echo U('Cart/adCart');?>", data, function (ret) {
                if (ret.code == 1) {
                    alert('添加购物车成功！');
                    history.go(0);
                    return false;
                }
                    alert('您还没登录！');
            })
        })
    })
</script>
</html>